<?php defined('IN_ADMIN') or exit('No permission resources.');?>
<?php include $this->admin_tpl('header', 'admin');?>
<script type="text/javascript">
	$(document).ready(function() {
		$.formValidator.initConfig({
			formid: "myform",
			autotip: true,
			onerror: function(msg, obj) {
				window.top.art.dialog({
					content: msg,
					lock: true,
					width: '200',
					height: '50'
				})
			}
		});
		$("#name").formValidator({
			onshow: "<?php echo L('input').L('contest_sponsor_name')?>",
			onfocus: "<?php echo L('input').L('contest_sponsor_name')?>"
		}).inputValidator({
			min: 1,
			onerror: "<?php echo L('input').L('contest_sponsor_name')?>"
		});


		$("#link").formValidator({
			onshow: "<?php echo L('input').L('contest_sponsor_link').",输入格式：http://www.baidu.com"?>",
			onfocus: "<?php echo L('input').L('contest_sponsor_link').",输入格式：http://www.baidu.com"?>"
		}).inputValidator({
			min: 1,
			onerror: "<?php echo L('input').L('contest_sponsor_link')?>"
		});





	});
</script>
<div class="pad-10">
	<form name="myform" action="?m=contest&c=sponsor&a=edit&id=<?php echo $id;?>" method="post"
		  id="myform" enctype="multipart/form-data">
		<input type="hidden" name="data[contest_id]" value="<?=$contest_id?>">

		<div class="content pad-10" id="show_div_1" style="height: auto">
			<fieldset>
				<legend><?php echo L('contest_sponsor_info')?></legend>
				<table width="100%" class="table_form">
					<tr>
						<td width="120"><?php echo L('contest_sponsor_name')?>：</td>
						<td><input type="text" name="data[name]" id="name"
								   class="input-text" value="<?= isset($data['name'])?$data['name']:""?>" /></td>
					</tr>


					<tr>
						<td width="120"><?php echo L('contest_sponsor_type')?>：</td>
						<td>
							<?php  echo form::select_default($this->sponsor_type,$data['type'],' name="data[type]"');?>
						</td>
					</tr>

					<tr>
						<td width="120"><?php echo L('contest_sponsor_link')?>：</td>
						<td><input type="text" name="data[link]" id="link"
								   class="input-text" value="<?= isset($data['link'])?$data['link']:""?>" /></td>
					</tr>

					<tr>
						<td width="120"><?php echo L('contest_sponsor_logo')?>：</td>

						<td><?php echo form::images('data[logo]', 'logo',isset($data['logo'])?$data['logo']:"", 'contest', '', 40)?></td>
					</tr>

					<tr>
						<td width="120"><?php echo L('contest_sponsor_description')?>：</td>
						<td><textarea rows="10" cols="80" name="data[description]"
									  id="description"><?php if(isset($data['description']) ) { echo $data['description'];}?></textarea>
						</td>
					</tr>


				</table>
			</fieldset>


		</div>
		<div class="bk15"></div>
		<input type="submit" class="dialog" id="dosubmit" name="dosubmit"
			   value="<?php echo L('submit')?>" />

	</form>

</div>
</body>
</html>